home *** CD-ROM | disk | FTP | other *** search
/ Champak 132 (Alt) / Vol 132.iso / games / balisa.swf / scripts / DefineSprite_60 / frame_15 / DoAction.as
Encoding:
Text File  |  2011-06-09  |  2.8 KB  |  94 lines

  1. stop();
  2. var seschocs = _root.voitureverte.chocs;
  3. var sonart = _root.voitureverte.noteArtistiqueFinale;
  4. var sonscore = Math.ceil(_root.voitureverte.score * 100);
  5. var sontemps = _root.elapsedTime;
  6. if(seschocs < 0)
  7. {
  8.    chocs.text = "";
  9. }
  10. else if(seschocs < 2)
  11. {
  12.    chocs.text = seschocs + " choc\n";
  13. }
  14. else
  15. {
  16.    chocs.text = seschocs + " chocs\n";
  17. }
  18. chocs.text += "artistique : " + sonart;
  19. score.text = "score : " + sonscore / 100;
  20. var position = -1;
  21. var total = -1;
  22. var parcoursenr = 0;
  23. enregistrer.onPress = function()
  24. {
  25.    _root.showButtons(false);
  26.    gotoAndPlay(16);
  27.    myVar = new LoadVars();
  28.    myVar.seschocs = seschocs;
  29.    myVar.sonart = sonart;
  30.    myVar.sonscore = sonscore;
  31.    myVar.sontemps = sontemps;
  32.    myVar.sonnom = sonnom;
  33.    myVar.sonsite = sonsite;
  34.    myVar.fc = _root.voitureverte.forceChocs;
  35.    myVar.position = -1;
  36.    myVar.total = -1;
  37.    myVar.sendAndLoad("derapage.php",myVar,"POST");
  38.    myVar.onLoad = function()
  39.    {
  40.       position = this.position;
  41.       total = this.total;
  42.       if(this.askparcours == 1)
  43.       {
  44.          _root.message.messagetext = "Enregistrement\ndu parcours :)";
  45.          _root.message.gotoAndPlay(2);
  46.          myParcours = new LoadVars();
  47.          myParcours.sonnom = sonnom;
  48.          myParcours.sonscore = sonscore;
  49.          myParcours.parcours = "1.01_";
  50.          tmpA = new Array();
  51.          i = 0;
  52.          while(i < _root.voitureverte.replayRecEventsIndex)
  53.          {
  54.             tmpA[i] = {clef:_root.voitureverte.replayEvents[i].updown + "_" + _root.getAlphaNum(_root.voitureverte.replayEvents[i].keycode),framenb:_root.voitureverte.replayEvents[i].framenb};
  55.             i++;
  56.          }
  57.          tmpA.sortOn(["clef","framenb"],Array.NUMERIC);
  58.          theCurrentKey = "";
  59.          i = 0;
  60.          while(i < _root.voitureverte.replayRecEventsIndex)
  61.          {
  62.             key = tmpA[i].clef;
  63.             if(key != theCurrentKey)
  64.             {
  65.                if(theCurrentKey != "")
  66.                {
  67.                   myParcours.parcours += "!";
  68.                }
  69.                theCurrentKey = key;
  70.                myParcours.parcours += theCurrentKey + "_" + _root.getAlphaNum(tmpA[i].framenb);
  71.             }
  72.             else
  73.             {
  74.                myParcours.parcours += "_" + _root.getAlphaNum(tmpA[i].framenb - tmpA[i - 1].framenb);
  75.             }
  76.             i++;
  77.          }
  78.          tmpA = new Array();
  79.          myParcours.sendAndLoad("derapage.php",myParcours,"POST");
  80.          myParcours.onLoad = function()
  81.          {
  82.             parcoursenr = this.parcoursenr;
  83.             _root.replayos.gotoAndPlay(2);
  84.             _root.showButtons(true);
  85.          };
  86.       }
  87.       else
  88.       {
  89.          _root.replayos.gotoAndPlay(2);
  90.          _root.showButtons(true);
  91.       }
  92.    };
  93. };
  94.